Skip to content

fix: UI uses translated keys if available#1290

Open
Math-Bee wants to merge 9 commits intoTagStudioDev:mainfrom
Math-Bee:quickfix
Open

fix: UI uses translated keys if available#1290
Math-Bee wants to merge 9 commits intoTagStudioDev:mainfrom
Math-Bee:quickfix

Conversation

@Math-Bee
Copy link
Contributor

@Math-Bee Math-Bee commented Jan 15, 2026

Summary

The settings dropdowns, thumbnail size options, and "all tags" tag search setting now get their translated text during .addItem:
The language is changed within ts_qt's __init__() function, but class definitions are executed when the file's imported; This means that if a translation is defined in a class definition (or outside any class/function), it uses the default language (english) rather than the correct language.
The translation variable definitions could have been moved inside the __init__() function of their class, but because they're not used by anything other than their comboboxes, it's simpler & more space efficient to just directly add them to their combobox

The deleting tags dialog is now a warning to match the deleting fields dialog, & uses the Discard StandardButton instead of the Ok one. The deleting fields dialog now uses StandardButtons instead of ButtonRoles for simplicity:
The exec() function doesn't return the button's ButtonRoles' value, it returns a value that depends on when you add the button; This wasn't super clear, especially since the statement that checks what button was pressed compares the result with ButtonRole.ActionRole.value, which only worked because it equals 3, and the correct button was the 2nd button added. The sort of button-checking implied by the code only actually works if you use StandardButtons, which is why it uses them now.

The color placeholder, the description of the folders to tags macro, and the deleting files dialog just needed to swap the explicit text for translated text.

Closes #1316.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@TrigamDev TrigamDev added Type: Translations Modifies translation keys or translation capabilities. Status: Review Needed A review of this is needed Type: Fix A fix for a bug, typo, or other issue labels Jan 18, 2026
@Math-Bee Math-Bee marked this pull request as draft February 19, 2026 21:08
@Math-Bee

This comment was marked as resolved.

Properly uses the translation keys for the setting options, in a very similar way to the thumbnail options
Fun Fact: this was already fixed in TagStudioDev#945, but got unfixed in TagStudioDev#1077. The comment was left behind, so I tidied that up too
imo this looks worse because the spacing isn't consistent, but whatever
Fixes the color placeholder, the "all tags" in tag search, and the description of the folder to tags macro not being translated
These ones are all 1 or 2 line fixes
The dialogs now have translated keys for all of their text. This does change a couple things:
- Deleting tags is a Warning message now, like deleting fields
- The 2 buttons for the field deletion dialog have swapped positions
- The "OK" button on the deleting tags dialog now uses the `generic.remove` key to be similar to deleting fields
- Deleting fields uses Standard Buttons (like deleting tags) because whatever it was doing previously was unnecessarily confusing
still using Standard Buttons. the main reason for switching is that it's a bit weird to work with Button Roles & that Button Roles aren't needed to do this
@Math-Bee Math-Bee changed the title fix: display translations for thumbnail size combobox options fix: UI uses translated keys if available Feb 20, 2026
discard should be better since it's closer to the actual action
@Math-Bee Math-Bee marked this pull request as ready for review February 20, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Review Needed A review of this is needed Type: Fix A fix for a bug, typo, or other issue Type: Translations Modifies translation keys or translation capabilities.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Some UI elements only use English strings, even when the translated keys are available

2 participants

Comments